{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "35396185-759b-4e06-81ee-7541e1a00aeb",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl\n",
    "from perspective.widget import PerspectiveWidget"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "0367782e-3827-4e45-9b70-b2e3fe8c0e1f",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = pl.read_parquet(\"new_share.parquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "bc81c299-5f7c-4553-b28c-f275e5998073",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = pl.read_parquet(\"stock_basic.parquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "67d81da4-65e0-4ad0-827e-fdc296edb8c4",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = d1.with_columns(\n",
    "    ipo_date=pl.col.ipo_date.str.to_date(\"%Y%m%d\"),\n",
    "    issue_date=pl.col.issue_date.str.to_date(\"%Y%m%d\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "53e5a4d1-4a8f-42d8-a831-d56a5ac72553",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = d2.with_columns(\n",
    "    list_date=pl.col.list_date.str.to_date(\"%Y%m%d\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "7cd8c7b1-c7bf-4615-8ecc-8570f46a585d",
   "metadata": {},
   "outputs": [],
   "source": [
    "config = '{\"version\":\"3.6.0\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"area\":{\"string_color_mode\":\"series\"}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[],\"filter\":[],\"expressions\":{},\"columns\":[\"ts_code\",\"symbol\",\"name\",\"area\",\"industry\",\"fullname\",\"enname\",\"cnspell\",\"market\",\"exchange\",\"curr_type\",\"list_status\",\"list_date\",\"delist_date\",\"is_hs\",\"act_name\",\"act_ent_type\"],\"aggregates\":{}}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "7dd14c8d-2970-4b7c-bdba-c35522c7862f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"version\":\"3.6.0\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"area\":{\"string_color_mode\":\"series\"}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[],\"filter\":[],\"expressions\":{},\"columns\":[\"ts_code\",\"symbol\",\"name\",\"area\",\"industry\",\"fullname\",\"enname\",\"cnspell\",\"market\",\"exchange\",\"curr_type\",\"list_status\",\"list_date\",\"delist_date\",\"is_hs\",\"act_name\",\"act_ent_type\"],\"aggregates\":{}}\n"
     ]
    }
   ],
   "source": [
    "print(config)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "9a2a152f-d80a-433d-8c25-1312f938e2cd",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "66db3a07-b989-41d2-a796-9e305d877a76",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "config2 = Path(\"C:/Users/71970/Desktop/金融计算机语言/untitled.config.json\").read_text(encoding=\"utf8\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "e9de0173-d237-437d-b0e8-5776d60d3735",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"version\":\"3.6.0\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"area\":{\"string_color_mode\":\"series\"}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[],\"filter\":[],\"expressions\":{},\"columns\":[\"ts_code\",\"symbol\",\"name\",\"area\",\"industry\",\"fullname\",\"enname\",\"cnspell\",\"market\",\"exchange\",\"curr_type\",\"list_status\",\"list_date\",\"delist_date\",\"is_hs\",\"act_name\",\"act_ent_type\"],\"aggregates\":{}}\n"
     ]
    }
   ],
   "source": [
    "print(config2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "2cf9c53a-d0cf-4336-bc9e-715811b85a78",
   "metadata": {},
   "outputs": [],
   "source": [
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "1687c5a4-d738-4ea0-ba3a-de11d3e27005",
   "metadata": {},
   "outputs": [],
   "source": [
    "d = json.loads(config)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "d27c9a98-06dd-406c-a51e-4cc96449b044",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'version': '3.6.0',\n",
       " 'plugin': 'Datagrid',\n",
       " 'plugin_config': {'columns': {},\n",
       "  'edit_mode': 'READ_ONLY',\n",
       "  'scroll_lock': False},\n",
       " 'columns_config': {'area': {'string_color_mode': 'series'}},\n",
       " 'settings': True,\n",
       " 'theme': 'Pro Light',\n",
       " 'title': None,\n",
       " 'group_by': [],\n",
       " 'split_by': [],\n",
       " 'sort': [],\n",
       " 'filter': [],\n",
       " 'expressions': {},\n",
       " 'columns': ['ts_code',\n",
       "  'symbol',\n",
       "  'name',\n",
       "  'area',\n",
       "  'industry',\n",
       "  'fullname',\n",
       "  'enname',\n",
       "  'cnspell',\n",
       "  'market',\n",
       "  'exchange',\n",
       "  'curr_type',\n",
       "  'list_status',\n",
       "  'list_date',\n",
       "  'delist_date',\n",
       "  'is_hs',\n",
       "  'act_name',\n",
       "  'act_ent_type'],\n",
       " 'aggregates': {}}"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "14bfaec9-15ed-48c1-be98-a163ad499fc2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(d)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "09f4fbac-9925-466e-b87d-f287821bb37f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d829b444bf8c41fda30993b3a56dc679",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(d1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "2b9c8fd0-f2d3-439a-b353-f76d0583be29",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "dc51ea9d67c14bfa813298b034f71339",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'symbol', 'name', 'area', 'industry', 'fullname',…"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(d2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "12df71d1-2cfa-423d-a159-caa04f421b53",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "PerspectiveViewer.__init__() got an unexpected keyword argument 'config'",
     "output_type": "error",
     "traceback": [
      "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
      "\u001b[31mTypeError\u001b[39m                                 Traceback (most recent call last)",
      "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[20]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m \u001b[43mPerspectiveWidget\u001b[49m\u001b[43m(\u001b[49m\u001b[43md2\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m=\u001b[49m\u001b[43md\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[36mFile \u001b[39m\u001b[32m~\\anaconda3\\envs\\week07\\Lib\\site-packages\\perspective\\widget\\__init__.py:140\u001b[39m, in \u001b[36mPerspectiveWidget.__init__\u001b[39m\u001b[34m(self, data, index, limit, binding_mode, **kwargs)\u001b[39m\n\u001b[32m    124\u001b[39m     \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m(\u001b[33m\"\u001b[39m\u001b[33mIndex and Limit cannot be set at the same time!\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m    126\u001b[39m \u001b[38;5;66;03m# Parse the dataset we pass in - if it's Pandas, preserve pivots\u001b[39;00m\n\u001b[32m    127\u001b[39m \u001b[38;5;66;03m# if isinstance(data, pandas.DataFrame) or isinstance(data, pandas.Series):\u001b[39;00m\n\u001b[32m    128\u001b[39m \u001b[38;5;66;03m#     data, config = deconstruct_pandas(data)\u001b[39;00m\n\u001b[32m   (...)\u001b[39m\u001b[32m    138\u001b[39m \n\u001b[32m    139\u001b[39m \u001b[38;5;66;03m# Initialize the viewer\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m140\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mPerspectiveWidget\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m.\u001b[49m\u001b[34;43m__init__\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    142\u001b[39m \u001b[38;5;66;03m# Handle messages from the the front end\u001b[39;00m\n\u001b[32m    143\u001b[39m \u001b[38;5;28mself\u001b[39m.on_msg(\u001b[38;5;28mself\u001b[39m.handle_message)\n",
      "\u001b[36mFile \u001b[39m\u001b[32m~\\anaconda3\\envs\\week07\\Lib\\site-packages\\ipywidgets\\widgets\\widget.py:503\u001b[39m, in \u001b[36mWidget.__init__\u001b[39m\u001b[34m(self, **kwargs)\u001b[39m\n\u001b[32m    501\u001b[39m \u001b[38;5;250m\u001b[39m\u001b[33;03m\"\"\"Public constructor\"\"\"\u001b[39;00m\n\u001b[32m    502\u001b[39m \u001b[38;5;28mself\u001b[39m._model_id = kwargs.pop(\u001b[33m'\u001b[39m\u001b[33mmodel_id\u001b[39m\u001b[33m'\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[32m--> \u001b[39m\u001b[32m503\u001b[39m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m.\u001b[49m\u001b[34;43m__init__\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m    505\u001b[39m Widget._call_widget_constructed(\u001b[38;5;28mself\u001b[39m)\n\u001b[32m    506\u001b[39m \u001b[38;5;28mself\u001b[39m.open()\n",
      "\u001b[31mTypeError\u001b[39m: PerspectiveViewer.__init__() got an unexpected keyword argument 'config'"
     ]
    }
   ],
   "source": [
    "PerspectiveWidget(d2, config=d)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "14e2d466-d094-44df-ba5f-e64bf842f5bf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2_000, 28)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>ts_code</th><th>sub_code</th><th>name</th><th>ipo_date</th><th>issue_date</th><th>amount</th><th>market_amount</th><th>price</th><th>pe</th><th>limit_amount</th><th>funds</th><th>ballot</th><th>symbol</th><th>name_right</th><th>area</th><th>industry</th><th>fullname</th><th>enname</th><th>cnspell</th><th>market</th><th>exchange</th><th>curr_type</th><th>list_status</th><th>list_date</th><th>delist_date</th><th>is_hs</th><th>act_name</th><th>act_ent_type</th></tr><tr><td>str</td><td>str</td><td>str</td><td>date</td><td>date</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>date</td><td>null</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;301595.SZ&quot;</td><td>&quot;301595&quot;</td><td>&quot;太力科技&quot;</td><td>2025-05-08</td><td>null</td><td>2707.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.65</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;688755.SH&quot;</td><td>&quot;787755&quot;</td><td>&quot;汉邦科技&quot;</td><td>2025-05-07</td><td>null</td><td>2200.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.5</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;301636.SZ&quot;</td><td>&quot;301636&quot;</td><td>&quot;泽润新能&quot;</td><td>2025-04-28</td><td>null</td><td>1597.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.45</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;001400.SZ&quot;</td><td>&quot;001400&quot;</td><td>&quot;江顺科技&quot;</td><td>2025-04-15</td><td>2025-04-24</td><td>1500.0</td><td>1500.0</td><td>37.36</td><td>15.32</td><td>1.5</td><td>5.604</td><td>0.01</td><td>&quot;001400&quot;</td><td>&quot;N江顺科&quot;</td><td>&quot;江苏&quot;</td><td>&quot;专用机械&quot;</td><td>&quot;江苏江顺精密科技集团股份有限公司&quot;</td><td>&quot;Giansun Precision Technology G…</td><td>&quot;jskj&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2025-04-24</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;301560.SZ&quot;</td><td>&quot;301560&quot;</td><td>&quot;众捷汽车&quot;</td><td>2025-04-15</td><td>2025-04-25</td><td>3040.0</td><td>1216.0</td><td>16.5</td><td>21.3</td><td>0.7</td><td>5.016</td><td>0.02</td><td>&quot;301560&quot;</td><td>&quot;众捷汽车&quot;</td><td>&quot;江苏&quot;</td><td>&quot;汽车配件&quot;</td><td>&quot;苏州众捷汽车零部件股份有限公司&quot;</td><td>&quot;PXI Auto Components (Suzhou) C…</td><td>&quot;zjqc&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2025-04-25</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;600989.SH&quot;</td><td>&quot;730989&quot;</td><td>&quot;宝丰能源&quot;</td><td>2019-04-30</td><td>2019-05-16</td><td>73336.0</td><td>66002.0</td><td>11.12</td><td>22.07</td><td>22.0</td><td>81.55</td><td>0.25</td><td>&quot;600989&quot;</td><td>&quot;宝丰能源&quot;</td><td>&quot;宁夏&quot;</td><td>&quot;化工原料&quot;</td><td>&quot;宁夏宝丰能源集团股份有限公司&quot;</td><td>&quot;Ningxia Baofeng Energy Group C…</td><td>&quot;bfny&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-16</td><td>null</td><td>&quot;H&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;300778.SZ&quot;</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>2019-04-25</td><td>2019-05-10</td><td>2000.0</td><td>2000.0</td><td>27.33</td><td>22.99</td><td>2.0</td><td>5.466</td><td>0.02</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>&quot;深圳&quot;</td><td>&quot;建筑工程&quot;</td><td>&quot;深圳市新城市规划建筑设计股份有限公司&quot;</td><td>&quot;Shenzhen New Land Tool Plannin…</td><td>&quot;xcs&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-10</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;002953.SZ&quot;</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>2019-04-24</td><td>2019-05-09</td><td>4302.0</td><td>3872.0</td><td>10.52</td><td>16.34</td><td>1.7</td><td>4.526</td><td>0.03</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>&quot;广东&quot;</td><td>&quot;电气设备&quot;</td><td>&quot;广东日丰电缆股份有限公司&quot;</td><td>&quot;Guangdong Rifeng Electric Cabl…</td><td>&quot;rfgf&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-09</td><td>null</td><td>&quot;N&quot;</td><td>&quot;冯就景&quot;</td><td>&quot;民营企业&quot;</td></tr><tr><td>&quot;603697.SH&quot;</td><td>&quot;732697&quot;</td><td>&quot;有友食品&quot;</td><td>2019-04-23</td><td>2019-05-08</td><td>7950.0</td><td>7155.0</td><td>7.87</td><td>13.92</td><td>3.1</td><td>6.257</td><td>0.05</td><td>&quot;603697&quot;</td><td>&quot;有友食品&quot;</td><td>&quot;重庆&quot;</td><td>&quot;食品&quot;</td><td>&quot;有友食品股份有限公司&quot;</td><td>&quot;Youyou Foods Co.,Ltd.&quot;</td><td>&quot;yysp&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-08</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;300772.SZ&quot;</td><td>&quot;300772&quot;</td><td>&quot;运达股份&quot;</td><td>2019-04-17</td><td>2019-04-26</td><td>7349.0</td><td>6614.0</td><td>6.52</td><td>22.97</td><td>2.8</td><td>4.792</td><td>0.04</td><td>&quot;300772&quot;</td><td>&quot;运达股份&quot;</td><td>&quot;浙江&quot;</td><td>&quot;电气设备&quot;</td><td>&quot;运达能源科技集团股份有限公司&quot;</td><td>&quot;Windey Energy Technology Group…</td><td>&quot;ydgf&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-04-26</td><td>null</td><td>&quot;S&quot;</td><td>null</td><td>null</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2_000, 28)\n",
       "┌───────────┬──────────┬──────────┬────────────┬───┬─────────────┬───────┬──────────┬──────────────┐\n",
       "│ ts_code   ┆ sub_code ┆ name     ┆ ipo_date   ┆ … ┆ delist_date ┆ is_hs ┆ act_name ┆ act_ent_type │\n",
       "│ ---       ┆ ---      ┆ ---      ┆ ---        ┆   ┆ ---         ┆ ---   ┆ ---      ┆ ---          │\n",
       "│ str       ┆ str      ┆ str      ┆ date       ┆   ┆ null        ┆ str   ┆ str      ┆ str          │\n",
       "╞═══════════╪══════════╪══════════╪════════════╪═══╪═════════════╪═══════╪══════════╪══════════════╡\n",
       "│ 301595.SZ ┆ 301595   ┆ 太力科技 ┆ 2025-05-08 ┆ … ┆ null        ┆ null  ┆ null     ┆ null         │\n",
       "│ 688755.SH ┆ 787755   ┆ 汉邦科技 ┆ 2025-05-07 ┆ … ┆ null        ┆ null  ┆ null     ┆ null         │\n",
       "│ 301636.SZ ┆ 301636   ┆ 泽润新能 ┆ 2025-04-28 ┆ … ┆ null        ┆ null  ┆ null     ┆ null         │\n",
       "│ 001400.SZ ┆ 001400   ┆ 江顺科技 ┆ 2025-04-15 ┆ … ┆ null        ┆ N     ┆ null     ┆ null         │\n",
       "│ 301560.SZ ┆ 301560   ┆ 众捷汽车 ┆ 2025-04-15 ┆ … ┆ null        ┆ N     ┆ null     ┆ null         │\n",
       "│ …         ┆ …        ┆ …        ┆ …          ┆ … ┆ …           ┆ …     ┆ …        ┆ …            │\n",
       "│ 600989.SH ┆ 730989   ┆ 宝丰能源 ┆ 2019-04-30 ┆ … ┆ null        ┆ H     ┆ null     ┆ null         │\n",
       "│ 300778.SZ ┆ 300778   ┆ 新城市   ┆ 2019-04-25 ┆ … ┆ null        ┆ N     ┆ null     ┆ null         │\n",
       "│ 002953.SZ ┆ 002953   ┆ 日丰股份 ┆ 2019-04-24 ┆ … ┆ null        ┆ N     ┆ 冯就景   ┆ 民营企业     │\n",
       "│ 603697.SH ┆ 732697   ┆ 有友食品 ┆ 2019-04-23 ┆ … ┆ null        ┆ N     ┆ null     ┆ null         │\n",
       "│ 300772.SZ ┆ 300772   ┆ 运达股份 ┆ 2019-04-17 ┆ … ┆ null        ┆ S     ┆ null     ┆ null         │\n",
       "└───────────┴──────────┴──────────┴────────────┴───┴─────────────┴───────┴──────────┴──────────────┘"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = d1.join(d2,on= \"ts_code\",how=\"left\")\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "56845673-2672-4f92-bc6d-48be9ca42db1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "eb1a511837514d9a907bb821f713c0d3",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "cd87c126-2151-4184-bba1-72ca4214d66c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a535329bdb564c298b78b0074ce02136",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "f22004b3-139a-476b-b5e1-4d4424651468",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "32c25a7395e647f198cab5016a06bf9e",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "c5b1571f-58cd-4446-aec4-72b7385be1e7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "eacd92f847414d3996ff851892e39410",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "955462b1-ca2f-46f5-b786-a8270ffc3b94",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
